//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS SecurityIR service.
///
/// This guide documents the action and response elements for use of the service.
public struct SecurityIR: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the SecurityIR client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "SecurityIR",
            serviceIdentifier: "security-ir",
            serviceProtocol: .restjson,
            apiVersion: "2018-05-10",
            endpoint: endpoint,
            errorType: SecurityIRErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Provides information on whether the supplied account IDs are associated with a membership.   AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be 123123123 which is nine digits, and with zero-prepend would be 000123123123. Not zero-prepending to 12 digits could result in errors.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_BatchGetMemberAccountDetails.html
    @Sendable
    @inlinable
    public func batchGetMemberAccountDetails(_ input: BatchGetMemberAccountDetailsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetMemberAccountDetailsResponse {
        try await self.client.execute(
            operation: "BatchGetMemberAccountDetails", 
            path: "/v1/membership/{membershipId}/batch-member-details", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Provides information on whether the supplied account IDs are associated with a membership.   AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be 123123123 which is nine digits, and with zero-prepend would be 000123123123. Not zero-prepending to 12 digits could result in errors.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_BatchGetMemberAccountDetails.html
    ///
    /// Parameters:
    ///   - accountIds: Optional element to query the membership relationship status to a provided list of account IDs.   AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be 123123123 which is nine digits, and with zero-prepend would be 000123123123. Not zero-prepending to 12 digits could result in errors.
    ///   - membershipId: Required element used in combination with BatchGetMemberAccountDetails to identify the membership ID to query.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetMemberAccountDetails(
        accountIds: [String],
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetMemberAccountDetailsResponse {
        let input = BatchGetMemberAccountDetailsRequest(
            accountIds: accountIds, 
            membershipId: membershipId
        )
        return try await self.batchGetMemberAccountDetails(input, logger: logger)
    }

    /// Cancels an existing membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CancelMembership.html
    @Sendable
    @inlinable
    public func cancelMembership(_ input: CancelMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelMembershipResponse {
        try await self.client.execute(
            operation: "CancelMembership", 
            path: "/v1/membership/{membershipId}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels an existing membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CancelMembership.html
    ///
    /// Parameters:
    ///   - membershipId: Required element used in combination with CancelMembershipRequest to identify the membership ID to cancel.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelMembership(
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelMembershipResponse {
        let input = CancelMembershipRequest(
            membershipId: membershipId
        )
        return try await self.cancelMembership(input, logger: logger)
    }

    /// Closes an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CloseCase.html
    @Sendable
    @inlinable
    public func closeCase(_ input: CloseCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CloseCaseResponse {
        try await self.client.execute(
            operation: "CloseCase", 
            path: "/v1/cases/{caseId}/close-case", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Closes an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CloseCase.html
    ///
    /// Parameters:
    ///   - caseId: Required element used in combination with CloseCase to identify the case ID to close.
    ///   - logger: Logger use during operation
    @inlinable
    public func closeCase(
        caseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CloseCaseResponse {
        let input = CloseCaseRequest(
            caseId: caseId
        )
        return try await self.closeCase(input, logger: logger)
    }

    /// Creates a new case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCase.html
    @Sendable
    @inlinable
    public func createCase(_ input: CreateCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCaseResponse {
        try await self.client.execute(
            operation: "CreateCase", 
            path: "/v1/create-case", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCase.html
    ///
    /// Parameters:
    ///   - clientToken:  The clientToken field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.
    ///   - description: Required element used in combination with CreateCase to provide a description for the new case.
    ///   - engagementType: Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation
    ///   - impactedAccounts: Required element used in combination with CreateCase to provide a list of impacted accounts.   AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be 123123123 which is nine digits, and with zero-prepend would be 000123123123. Not zero-prepending to 12 digits could result in errors.
    ///   - impactedAwsRegions: An optional element used in combination with CreateCase to provide a list of impacted regions.
    ///   - impactedServices: An optional element used in combination with CreateCase to provide a list of services impacted.
    ///   - reportedIncidentStartDate: Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.
    ///   - resolverType: Required element used in combination with CreateCase to identify the resolver type.
    ///   - tags: An optional element used in combination with CreateCase to add customer specified tags to a case.
    ///   - threatActorIpAddresses: An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.
    ///   - title: Required element used in combination with CreateCase to provide a title for the new case.
    ///   - watchers: Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.
    ///   - logger: Logger use during operation
    @inlinable
    public func createCase(
        clientToken: String? = nil,
        description: String,
        engagementType: EngagementType,
        impactedAccounts: [String],
        impactedAwsRegions: [ImpactedAwsRegion]? = nil,
        impactedServices: [String]? = nil,
        reportedIncidentStartDate: Date,
        resolverType: ResolverType,
        tags: [String: String]? = nil,
        threatActorIpAddresses: [ThreatActorIp]? = nil,
        title: String,
        watchers: [Watcher],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCaseResponse {
        let input = CreateCaseRequest(
            clientToken: clientToken, 
            description: description, 
            engagementType: engagementType, 
            impactedAccounts: impactedAccounts, 
            impactedAwsRegions: impactedAwsRegions, 
            impactedServices: impactedServices, 
            reportedIncidentStartDate: reportedIncidentStartDate, 
            resolverType: resolverType, 
            tags: tags, 
            threatActorIpAddresses: threatActorIpAddresses, 
            title: title, 
            watchers: watchers
        )
        return try await self.createCase(input, logger: logger)
    }

    /// Adds a comment to an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCaseComment.html
    @Sendable
    @inlinable
    public func createCaseComment(_ input: CreateCaseCommentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCaseCommentResponse {
        try await self.client.execute(
            operation: "CreateCaseComment", 
            path: "/v1/cases/{caseId}/create-comment", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds a comment to an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCaseComment.html
    ///
    /// Parameters:
    ///   - body: Required element used in combination with CreateCaseComment to add content for the new comment.
    ///   - caseId: Required element used in combination with CreateCaseComment to specify a case ID.
    ///   - clientToken:  The clientToken field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.
    ///   - logger: Logger use during operation
    @inlinable
    public func createCaseComment(
        body: String,
        caseId: String,
        clientToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCaseCommentResponse {
        let input = CreateCaseCommentRequest(
            body: body, 
            caseId: caseId, 
            clientToken: clientToken
        )
        return try await self.createCaseComment(input, logger: logger)
    }

    /// Creates a new membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateMembership.html
    @Sendable
    @inlinable
    public func createMembership(_ input: CreateMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateMembershipResponse {
        try await self.client.execute(
            operation: "CreateMembership", 
            path: "/v1/membership", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateMembership.html
    ///
    /// Parameters:
    ///   - clientToken:  The clientToken field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.
    ///   - coverEntireOrganization: The coverEntireOrganization parameter is a boolean flag that determines whether the membership should be applied to the entire Amazon Web Services Organization. When set to true, the membership will be created for all accounts within the organization. When set to false, the membership will only be created for specified accounts.  This parameter is optional. If not specified, the default value is false.   If set to true: The membership will automatically include all existing and future accounts in the Amazon Web Services Organization.    If set to false: The membership will only apply to explicitly specified accounts.
    ///   - incidentResponseTeam: Required element used in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.
    ///   - membershipName: Required element used in combination with CreateMembership to create a name for the membership.
    ///   - optInFeatures: Optional element to enable the monitoring and investigation opt-in features for the service.
    ///   - tags: Optional element for customer configured tags.
    ///   - logger: Logger use during operation
    @inlinable
    public func createMembership(
        clientToken: String? = nil,
        coverEntireOrganization: Bool? = nil,
        incidentResponseTeam: [IncidentResponder],
        membershipName: String,
        optInFeatures: [OptInFeature]? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateMembershipResponse {
        let input = CreateMembershipRequest(
            clientToken: clientToken, 
            coverEntireOrganization: coverEntireOrganization, 
            incidentResponseTeam: incidentResponseTeam, 
            membershipName: membershipName, 
            optInFeatures: optInFeatures, 
            tags: tags
        )
        return try await self.createMembership(input, logger: logger)
    }

    /// Returns the attributes of a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCase.html
    @Sendable
    @inlinable
    public func getCase(_ input: GetCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCaseResponse {
        try await self.client.execute(
            operation: "GetCase", 
            path: "/v1/cases/{caseId}/get-case", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the attributes of a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCase.html
    ///
    /// Parameters:
    ///   - caseId: Required element for GetCase to identify the requested case ID.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCase(
        caseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCaseResponse {
        let input = GetCaseRequest(
            caseId: caseId
        )
        return try await self.getCase(input, logger: logger)
    }

    /// Returns a Pre-Signed URL for uploading attachments into a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentDownloadUrl.html
    @Sendable
    @inlinable
    public func getCaseAttachmentDownloadUrl(_ input: GetCaseAttachmentDownloadUrlRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCaseAttachmentDownloadUrlResponse {
        try await self.client.execute(
            operation: "GetCaseAttachmentDownloadUrl", 
            path: "/v1/cases/{caseId}/get-presigned-url/{attachmentId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a Pre-Signed URL for uploading attachments into a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentDownloadUrl.html
    ///
    /// Parameters:
    ///   - attachmentId: Required element for GetCaseAttachmentDownloadUrl to identify the attachment ID for downloading an attachment.
    ///   - caseId: Required element for GetCaseAttachmentDownloadUrl to identify the case ID for downloading an attachment from.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCaseAttachmentDownloadUrl(
        attachmentId: String,
        caseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCaseAttachmentDownloadUrlResponse {
        let input = GetCaseAttachmentDownloadUrlRequest(
            attachmentId: attachmentId, 
            caseId: caseId
        )
        return try await self.getCaseAttachmentDownloadUrl(input, logger: logger)
    }

    /// Uploads an attachment to a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentUploadUrl.html
    @Sendable
    @inlinable
    public func getCaseAttachmentUploadUrl(_ input: GetCaseAttachmentUploadUrlRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCaseAttachmentUploadUrlResponse {
        try await self.client.execute(
            operation: "GetCaseAttachmentUploadUrl", 
            path: "/v1/cases/{caseId}/get-presigned-url", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Uploads an attachment to a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentUploadUrl.html
    ///
    /// Parameters:
    ///   - caseId: Required element for GetCaseAttachmentUploadUrl to identify the case ID for uploading an attachment.
    ///   - clientToken:  The clientToken field is an idempotency key used to ensure that repeated attempts for a single action will be ignored by the server during retries. A caller supplied unique ID (typically a UUID) should be provided.
    ///   - contentLength: Required element for GetCaseAttachmentUploadUrl to identify the size of the file attachment.
    ///   - fileName: Required element for GetCaseAttachmentUploadUrl to identify the file name of the attachment to upload.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCaseAttachmentUploadUrl(
        caseId: String,
        clientToken: String? = nil,
        contentLength: Int64,
        fileName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCaseAttachmentUploadUrlResponse {
        let input = GetCaseAttachmentUploadUrlRequest(
            caseId: caseId, 
            clientToken: clientToken, 
            contentLength: contentLength, 
            fileName: fileName
        )
        return try await self.getCaseAttachmentUploadUrl(input, logger: logger)
    }

    /// Returns the attributes of a membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetMembership.html
    @Sendable
    @inlinable
    public func getMembership(_ input: GetMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetMembershipResponse {
        try await self.client.execute(
            operation: "GetMembership", 
            path: "/v1/membership/{membershipId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the attributes of a membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetMembership.html
    ///
    /// Parameters:
    ///   - membershipId: Required element for GetMembership to identify the membership ID to query.
    ///   - logger: Logger use during operation
    @inlinable
    public func getMembership(
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetMembershipResponse {
        let input = GetMembershipRequest(
            membershipId: membershipId
        )
        return try await self.getMembership(input, logger: logger)
    }

    /// Views the case history for edits made to a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCaseEdits.html
    @Sendable
    @inlinable
    public func listCaseEdits(_ input: ListCaseEditsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCaseEditsResponse {
        try await self.client.execute(
            operation: "ListCaseEdits", 
            path: "/v1/cases/{caseId}/list-case-edits", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Views the case history for edits made to a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCaseEdits.html
    ///
    /// Parameters:
    ///   - caseId: Required element used with ListCaseEdits to identify the case to query.
    ///   - maxResults: Optional element to identify how many results to obtain. There is a maximum value of 25.
    ///   - nextToken: An optional string that, if supplied, must be copied from the output of a previous call to ListCaseEdits. When provided in this manner, the API fetches the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listCaseEdits(
        caseId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCaseEditsResponse {
        let input = ListCaseEditsRequest(
            caseId: caseId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listCaseEdits(input, logger: logger)
    }

    /// Lists all cases the requester has access to.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCases.html
    @Sendable
    @inlinable
    public func listCases(_ input: ListCasesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCasesResponse {
        try await self.client.execute(
            operation: "ListCases", 
            path: "/v1/list-cases", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all cases the requester has access to.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCases.html
    ///
    /// Parameters:
    ///   - maxResults: Optional element for ListCases to limit the number of responses.
    ///   - nextToken: An optional string that, if supplied, must be copied from the output of a previous call to ListCases. When provided in this manner, the API fetches the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listCases(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCasesResponse {
        let input = ListCasesRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listCases(input, logger: logger)
    }

    /// Returns comments for a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListComments.html
    @Sendable
    @inlinable
    public func listComments(_ input: ListCommentsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCommentsResponse {
        try await self.client.execute(
            operation: "ListComments", 
            path: "/v1/cases/{caseId}/list-comments", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns comments for a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListComments.html
    ///
    /// Parameters:
    ///   - caseId: Required element for ListComments to designate the case to query.
    ///   - maxResults: Optional element for ListComments to limit the number of responses.
    ///   - nextToken: An optional string that, if supplied, must be copied from the output of a previous call to ListComments. When provided in this manner, the API fetches the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listComments(
        caseId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCommentsResponse {
        let input = ListCommentsRequest(
            caseId: caseId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listComments(input, logger: logger)
    }

    /// Returns the memberships that the calling principal can access.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListMemberships.html
    @Sendable
    @inlinable
    public func listMemberships(_ input: ListMembershipsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListMembershipsResponse {
        try await self.client.execute(
            operation: "ListMemberships", 
            path: "/v1/memberships", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the memberships that the calling principal can access.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListMemberships.html
    ///
    /// Parameters:
    ///   - maxResults: Request element for ListMemberships to limit the number of responses.
    ///   - nextToken: An optional string that, if supplied, must be copied from the output of a previous call to ListMemberships. When provided in this manner, the API fetches the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listMemberships(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListMembershipsResponse {
        let input = ListMembershipsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listMemberships(input, logger: logger)
    }

    /// Returns currently configured tags on a resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListTagsForResource.html
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/v1/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns currently configured tags on a resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListTagsForResource.html
    ///
    /// Parameters:
    ///   - resourceArn: Required element for ListTagsForResource to provide the ARN to identify a specific resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Adds a tag(s) to a designated resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_TagResource.html
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/v1/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds a tag(s) to a designated resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_TagResource.html
    ///
    /// Parameters:
    ///   - resourceArn: Required element for TagResource to identify the ARN for the resource to add a tag to.
    ///   - tags: Required element for ListTagsForResource to provide the content for a tag.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes a tag(s) from a designate resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UntagResource.html
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/v1/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes a tag(s) from a designate resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UntagResource.html
    ///
    /// Parameters:
    ///   - resourceArn: Required element for UnTagResource to identify the ARN for the resource to remove a tag from.
    ///   - tagKeys: Required element for UnTagResource to identify tag to remove.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCase.html
    @Sendable
    @inlinable
    public func updateCase(_ input: UpdateCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCaseResponse {
        try await self.client.execute(
            operation: "UpdateCase", 
            path: "/v1/cases/{caseId}/update-case", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCase.html
    ///
    /// Parameters:
    ///   - actualIncidentStartDate: Optional element for UpdateCase to provide content for the incident start date field.
    ///   - caseId: Required element for UpdateCase to identify the case ID for updates.
    ///   - description: Optional element for UpdateCase to provide content for the description field.
    ///   - engagementType: Optional element for UpdateCase to provide content for the engagement type field. Available engagement types include Security Incident | Investigation.
    ///   - impactedAccountsToAdd: Optional element for UpdateCase to provide content to add accounts impacted.   AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be 123123123 which is nine digits, and with zero-prepend would be 000123123123. Not zero-prepending to 12 digits could result in errors.
    ///   - impactedAccountsToDelete: Optional element for UpdateCase to provide content to add accounts impacted.   AWS account ID's may appear less than 12 characters and need to be zero-prepended. An example would be 123123123 which is nine digits, and with zero-prepend would be 000123123123. Not zero-prepending to 12 digits could result in errors.
    ///   - impactedAwsRegionsToAdd: Optional element for UpdateCase to provide content to add regions impacted.
    ///   - impactedAwsRegionsToDelete: Optional element for UpdateCase to provide content to remove regions impacted.
    ///   - impactedServicesToAdd: Optional element for UpdateCase to provide content to add services impacted.
    ///   - impactedServicesToDelete: Optional element for UpdateCase to provide content to remove services impacted.
    ///   - reportedIncidentStartDate: Optional element for UpdateCase to provide content for the customer reported incident start date field.
    ///   - threatActorIpAddressesToAdd: Optional element for UpdateCase to provide content to add additional suspicious IP addresses related to a case.
    ///   - threatActorIpAddressesToDelete: Optional element for UpdateCase to provide content to remove suspicious IP addresses from a case.
    ///   - title: Optional element for UpdateCase to provide content for the title field.
    ///   - watchersToAdd: Optional element for UpdateCase to provide content to add additional watchers to a case.
    ///   - watchersToDelete: Optional element for UpdateCase to provide content to remove existing watchers from a case.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCase(
        actualIncidentStartDate: Date? = nil,
        caseId: String,
        description: String? = nil,
        engagementType: EngagementType? = nil,
        impactedAccountsToAdd: [String]? = nil,
        impactedAccountsToDelete: [String]? = nil,
        impactedAwsRegionsToAdd: [ImpactedAwsRegion]? = nil,
        impactedAwsRegionsToDelete: [ImpactedAwsRegion]? = nil,
        impactedServicesToAdd: [String]? = nil,
        impactedServicesToDelete: [String]? = nil,
        reportedIncidentStartDate: Date? = nil,
        threatActorIpAddressesToAdd: [ThreatActorIp]? = nil,
        threatActorIpAddressesToDelete: [ThreatActorIp]? = nil,
        title: String? = nil,
        watchersToAdd: [Watcher]? = nil,
        watchersToDelete: [Watcher]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCaseResponse {
        let input = UpdateCaseRequest(
            actualIncidentStartDate: actualIncidentStartDate, 
            caseId: caseId, 
            description: description, 
            engagementType: engagementType, 
            impactedAccountsToAdd: impactedAccountsToAdd, 
            impactedAccountsToDelete: impactedAccountsToDelete, 
            impactedAwsRegionsToAdd: impactedAwsRegionsToAdd, 
            impactedAwsRegionsToDelete: impactedAwsRegionsToDelete, 
            impactedServicesToAdd: impactedServicesToAdd, 
            impactedServicesToDelete: impactedServicesToDelete, 
            reportedIncidentStartDate: reportedIncidentStartDate, 
            threatActorIpAddressesToAdd: threatActorIpAddressesToAdd, 
            threatActorIpAddressesToDelete: threatActorIpAddressesToDelete, 
            title: title, 
            watchersToAdd: watchersToAdd, 
            watchersToDelete: watchersToDelete
        )
        return try await self.updateCase(input, logger: logger)
    }

    /// Updates an existing case comment.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseComment.html
    @Sendable
    @inlinable
    public func updateCaseComment(_ input: UpdateCaseCommentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCaseCommentResponse {
        try await self.client.execute(
            operation: "UpdateCaseComment", 
            path: "/v1/cases/{caseId}/update-case-comment/{commentId}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing case comment.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseComment.html
    ///
    /// Parameters:
    ///   - body: Required element for UpdateCaseComment to identify the content for the comment to be updated.
    ///   - caseId: Required element for UpdateCaseComment to identify the case ID containing the comment to be updated.
    ///   - commentId: Required element for UpdateCaseComment to identify the case ID to be updated.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCaseComment(
        body: String,
        caseId: String,
        commentId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCaseCommentResponse {
        let input = UpdateCaseCommentRequest(
            body: body, 
            caseId: caseId, 
            commentId: commentId
        )
        return try await self.updateCaseComment(input, logger: logger)
    }

    /// Updates the state transitions for a designated cases.  Self-managed: the following states are available for self-managed cases.    Submitted → Detection and Analysis   Detection and Analysis → Containment, Eradication, and Recovery   Detection and Analysis → Post-incident Activities   Containment, Eradication, and Recovery → Detection and Analysis   Containment, Eradication, and Recovery → Post-incident Activities   Post-incident Activities → Containment, Eradication, and Recovery   Post-incident Activities → Detection and Analysis   Any → Closed    AWS supported: You must use the CloseCase API to close.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseStatus.html
    @Sendable
    @inlinable
    public func updateCaseStatus(_ input: UpdateCaseStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCaseStatusResponse {
        try await self.client.execute(
            operation: "UpdateCaseStatus", 
            path: "/v1/cases/{caseId}/update-case-status", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the state transitions for a designated cases.  Self-managed: the following states are available for self-managed cases.    Submitted → Detection and Analysis   Detection and Analysis → Containment, Eradication, and Recovery   Detection and Analysis → Post-incident Activities   Containment, Eradication, and Recovery → Detection and Analysis   Containment, Eradication, and Recovery → Post-incident Activities   Post-incident Activities → Containment, Eradication, and Recovery   Post-incident Activities → Detection and Analysis   Any → Closed    AWS supported: You must use the CloseCase API to close.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseStatus.html
    ///
    /// Parameters:
    ///   - caseId: Required element for UpdateCaseStatus to identify the case to update.
    ///   - caseStatus: Required element for UpdateCaseStatus to identify the status for a case. Options include Submitted | Detection and Analysis | Containment, Eradication and Recovery | Post-incident Activities.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCaseStatus(
        caseId: String,
        caseStatus: SelfManagedCaseStatus,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCaseStatusResponse {
        let input = UpdateCaseStatusRequest(
            caseId: caseId, 
            caseStatus: caseStatus
        )
        return try await self.updateCaseStatus(input, logger: logger)
    }

    /// Updates membership configuration.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateMembership.html
    @Sendable
    @inlinable
    public func updateMembership(_ input: UpdateMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateMembershipResponse {
        try await self.client.execute(
            operation: "UpdateMembership", 
            path: "/v1/membership/{membershipId}/update-membership", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates membership configuration.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateMembership.html
    ///
    /// Parameters:
    ///   - incidentResponseTeam: Optional element for UpdateMembership to update the membership name.
    ///   - membershipAccountsConfigurationsUpdate: The membershipAccountsConfigurationsUpdate field in the UpdateMembershipRequest structure allows you to update the configuration settings for accounts within a membership.  This field is optional and contains a structure of type MembershipAccountsConfigurationsUpdate  that specifies the updated account configurations for the membership.
    ///   - membershipId: Required element for UpdateMembership to identify the membership to update.
    ///   - membershipName: Optional element for UpdateMembership to update the membership name.
    ///   - optInFeatures: Optional element for UpdateMembership to enable or disable opt-in features for the service.
    ///   - undoMembershipCancellation: The undoMembershipCancellation parameter is a boolean flag that indicates whether to reverse a previously requested membership cancellation. When set to true, this will revoke the cancellation request and maintain the membership status.  This parameter is optional and can be used in scenarios where you need to restore a membership that was marked for cancellation but hasn't been fully terminated yet.    If set to true, the cancellation request will be revoked    If set to false the service will throw a ValidationException.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateMembership(
        incidentResponseTeam: [IncidentResponder]? = nil,
        membershipAccountsConfigurationsUpdate: MembershipAccountsConfigurationsUpdate? = nil,
        membershipId: String,
        membershipName: String? = nil,
        optInFeatures: [OptInFeature]? = nil,
        undoMembershipCancellation: Bool? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateMembershipResponse {
        let input = UpdateMembershipRequest(
            incidentResponseTeam: incidentResponseTeam, 
            membershipAccountsConfigurationsUpdate: membershipAccountsConfigurationsUpdate, 
            membershipId: membershipId, 
            membershipName: membershipName, 
            optInFeatures: optInFeatures, 
            undoMembershipCancellation: undoMembershipCancellation
        )
        return try await self.updateMembership(input, logger: logger)
    }

    /// Updates the resolver type for a case.  This is a one-way action and cannot be reversed.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateResolverType.html
    @Sendable
    @inlinable
    public func updateResolverType(_ input: UpdateResolverTypeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateResolverTypeResponse {
        try await self.client.execute(
            operation: "UpdateResolverType", 
            path: "/v1/cases/{caseId}/update-resolver-type", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the resolver type for a case.  This is a one-way action and cannot be reversed.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateResolverType.html
    ///
    /// Parameters:
    ///   - caseId: Required element for UpdateResolverType to identify the case to update.
    ///   - resolverType: Required element for UpdateResolverType to identify the new resolver.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateResolverType(
        caseId: String,
        resolverType: ResolverType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateResolverTypeResponse {
        let input = UpdateResolverTypeRequest(
            caseId: caseId, 
            resolverType: resolverType
        )
        return try await self.updateResolverType(input, logger: logger)
    }
}

extension SecurityIR {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: SecurityIR, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension SecurityIR {
    /// Return PaginatorSequence for operation ``listCaseEdits(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCaseEditsPaginator(
        _ input: ListCaseEditsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCaseEditsRequest, ListCaseEditsResponse> {
        return .init(
            input: input,
            command: self.listCaseEdits,
            inputKey: \ListCaseEditsRequest.nextToken,
            outputKey: \ListCaseEditsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listCaseEdits(_:logger:)``.
    ///
    /// - Parameters:
    ///   - caseId: Required element used with ListCaseEdits to identify the case to query.
    ///   - maxResults: Optional element to identify how many results to obtain. There is a maximum value of 25.
    ///   - logger: Logger used for logging
    @inlinable
    public func listCaseEditsPaginator(
        caseId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCaseEditsRequest, ListCaseEditsResponse> {
        let input = ListCaseEditsRequest(
            caseId: caseId, 
            maxResults: maxResults
        )
        return self.listCaseEditsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCasesPaginator(
        _ input: ListCasesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCasesRequest, ListCasesResponse> {
        return .init(
            input: input,
            command: self.listCases,
            inputKey: \ListCasesRequest.nextToken,
            outputKey: \ListCasesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Optional element for ListCases to limit the number of responses.
    ///   - logger: Logger used for logging
    @inlinable
    public func listCasesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCasesRequest, ListCasesResponse> {
        let input = ListCasesRequest(
            maxResults: maxResults
        )
        return self.listCasesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listComments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCommentsPaginator(
        _ input: ListCommentsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCommentsRequest, ListCommentsResponse> {
        return .init(
            input: input,
            command: self.listComments,
            inputKey: \ListCommentsRequest.nextToken,
            outputKey: \ListCommentsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listComments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - caseId: Required element for ListComments to designate the case to query.
    ///   - maxResults: Optional element for ListComments to limit the number of responses.
    ///   - logger: Logger used for logging
    @inlinable
    public func listCommentsPaginator(
        caseId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCommentsRequest, ListCommentsResponse> {
        let input = ListCommentsRequest(
            caseId: caseId, 
            maxResults: maxResults
        )
        return self.listCommentsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listMemberships(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listMembershipsPaginator(
        _ input: ListMembershipsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListMembershipsRequest, ListMembershipsResponse> {
        return .init(
            input: input,
            command: self.listMemberships,
            inputKey: \ListMembershipsRequest.nextToken,
            outputKey: \ListMembershipsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listMemberships(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Request element for ListMemberships to limit the number of responses.
    ///   - logger: Logger used for logging
    @inlinable
    public func listMembershipsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListMembershipsRequest, ListMembershipsResponse> {
        let input = ListMembershipsRequest(
            maxResults: maxResults
        )
        return self.listMembershipsPaginator(input, logger: logger)
    }
}

extension SecurityIR.ListCaseEditsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListCaseEditsRequest {
        return .init(
            caseId: self.caseId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension SecurityIR.ListCasesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListCasesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension SecurityIR.ListCommentsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListCommentsRequest {
        return .init(
            caseId: self.caseId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension SecurityIR.ListMembershipsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListMembershipsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
